package oop.controller.action.answer;

import oop.controller.action.DefaultAction;
import oop.db.dao.AnswerDAO;
import oop.db.dao.QuestionAnswerDAO;

public class DeleteAction extends DefaultAction {

	@Override
	public void performImpl() throws Exception {
		long questionId = getParams().getLong("question");
		long answerId = getParams().getLong("answer");
		
		QuestionAnswerDAO.removeAnswer(questionId, answerId);
		AnswerDAO.drop(answerId);
		
		setNextAction("question.view&qv_id=" + questionId);
	}

}
